import { ApiCall } from "tsrpc";
import { ReqFindPass, ResFindPass } from "../../shared/protocols/Login/PtlFindPass";
import { Global } from "../../Global";

export default async function (call: ApiCall<ReqFindPass, ResFindPass>) {
    // TODO
    const { email, password } = call.req

    await Global.collection('users').updateOne({
        email
    }, {
        $set: {
            password
        }
    })

    call.succ({})
}